<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="lib/vue.js"></script>
</head>
<body>
<div id="app">
    <input type="text" v-model="f1" >+
    <input type="text" v-model="f2" >=
    <input type="text" v-model="f3">
</div>


<script>
  var vm=new Vue({
    el:"#app",
    data:{
      f1:"",
      f2:"",
      f3:""
    },
    methods:{},
    watch:{
      //监视数据变化，然后出发对应的watch函数
      f1:function () {
        this.f3=this.f1+this.f2
      }
    }
  })
</script>
</body>
</html>